package tok

import (
	"testing"
)

func TestNewToken(t *testing.T) {
	token := NewToken(STRING, "hello", 1, 1)
	
	if token.Type != STRING {
		t.Errorf("expected token type %s, got %s", STRING, token.Type)
	}
	
	if token.Literal != "hello" {
		t.Errorf("expected literal %s, got %s", "hello", token.Literal)
	}
	
	if token.Line != 1 {
		t.Errorf("expected line %d, got %d", 1, token.Line)
	}
	
	if token.Column != 1 {
		t.Errorf("expected column %d, got %d", 1, token.Column)
	}
}

func TestTokenTypes(t *testing.T) {
	tests := []struct {
		typeName TokenType
		expected string
	}{
		{ILLEGAL, "ILLEGAL"},
		{EOF, "EOF"},
		{STRING, "STRING"},
		{SYMBOL, "SYMBOL"},
		{DEFINE, "DEFINE"},
		{DISPLAY, "DISPLAY"},
		{LPAREN, "LPAREN"},
		{RPAREN, "RPAREN"},
	}
	
	for _, tt := range tests {
		if string(tt.typeName) != tt.expected {
			t.Errorf("expected %s, got %s", tt.expected, string(tt.typeName))
		}
	}
}